﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> scores = new List<int>();

            Console.WriteLine("Please input your scores");
           
            string input = "";

            while (input != "stop")
            {
                input = Console.ReadLine();
                int result = 0;

                if (int.TryParse(input, out result))
                {
                    scores.Add(result);
                }
                else
                {
                    Console.WriteLine("Please input an integer");
                }
            }

            Console.WriteLine("Your score is " + CalculateAverage(scores));
            Console.ReadLine();

        }

       static int CalculateAverage(List<int> scores)
        {
            int result = 0;

            foreach (int i in scores)
            {
                result += i;
            }
            return result / scores.Count;
        }
    }
}

